package com.meta.platform.area.service;

import com.meta.platform.area.domain.Areas;
import com.meta.platform.area.io.AreaDistrictIo;
import com.meta.platform.area.io.AreaTree;
import com.meta.platform.area.io.District;
import com.meta.platform.area.io.Province;
import com.meta.platform.area.req.ro.AreasRo;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 地区信息
 * 
 * @author M.simple
 * @email 1111111111111@qq.com
 * @date 2020-07-14 18:05:05
 */
public interface AreasQryService {

	/**
	 * list Areas info
	 * @method      listAreas
	 * @param       areas:
	 * @return      List<Areas>
	 * @author      M.simple
	 * @date        2020-07-14 18:05:05
	 */
	List<Areas> listAreas(AreasRo areas);

	Areas queryProvince(Long provinceId);

	Areas queryCity(Long cityId);

	Areas queryCounty(Long countyId);

	String queryAddress(Long countyId, List<Areas> areas);

	String queryFullAddress(Long areaId);

	List<Long> queryFullAddressIds(Long areaId);

	AreaTree queryAreaTree(Long areaId);

	Set<Long> getChildrenAreaId(List<Long> areaIds);

	/* 找到一颗树中某个节点 */
	AreaTree findAreaTreeById(AreaTree areaTree, Long nodeId);

	/* 返回当前节点的晚辈集合 */
	List<AreaTree> getJuniors(AreaTree areaTree);

	List<Areas> queryAllArea();

	List<Areas> getParentArea(Long childId);

	List<Areas> getParentArea(Long childId, Map<Long, Areas> childParentAreaMap);

	String getFullAddress(Long childId, List<Areas> areaAllList);

	Map<Long, Areas> getChildParentAreaMap();

	List<Province> queryAllAddress();

	/**
	 * 查询下一节点区域信息
	 * @method      listNextLevelArea
	 * @param       parentId:
	 * @return      List<AreaDistrictIo>
	 * @author      M.simple
	 * @date        2020/7/28 8:05 下午
	 * @version     v2.0
	 */
	List<AreaDistrictIo> listNextLevelArea(Long parentId, String keyword);

	/**
	 * 获取区域信息
	 * @method      getAreaByAreaId
	 * @param       areaId:
	 * @return      Areas
	 * @author      M.simple
	 * @date        2020/7/29 10:47 上午
	 * @version     v2.0
	 */
	Areas getAreaByAreaId(Long areaId);

	/**
	 * list all level area info province-city-dintrict
	 * @method      listAllLevelArea
	 * @param       :level
	 * @return
	 * @author      M.simple
	 * @date        2020/7/29 2:05 下午
	 * @version     v2.0
	 */
	List<Province> listAllLevelArea(Integer level);

	List<District> listDistrict(Long cityId);

	List<Areas> batchListArea(List<Long> areaIdList);
}
